#!/bin/bash
#Collect information over 10 second time interval

iostat -x 10 2 |
while read line
do
	if [[ "$line" =~ "avg-cpu" ]]; then
		if [[ $count -eq 1 ]]; then
			read line
			echo $line | awk '{print $NF}'
		fi

	elif [[ "$line" =~ "sda " ]]; then	#Match only sda (not sda1 etc)
		if [[ $count -eq 0 ]]; then
			count=`expr $count + 1`
		else
			echo $line | awk '{print $6; print$7}'
		fi
	fi
done
